var prefix = ctx + "mfilm";
var ajaxfix = ctx + "ajax/mfilm";
$(function () {
    var options = {
        url: ajaxfix + "/listdo",
        createUrl: prefix + "/add",
        updateUrl: prefix + "/edit/{id}",
        removeUrl: ajaxfix + "/remove",
        sortName: "id",
        modalName: "列表",
        columns: [{
            checkbox: true
        },
            {
                field: 'id',
                title: 'ID',
                visible: false
            },
            {
                field: 'id',
                title: ''
            },
            {
                field: 'name',
                title: '名称'
            },
            {
                field: 'otherName',
                title: '别名'
            },
            {
                field: 'img',
                title: '缩略图'
            },
            {
                field: 'director',
                title: '导演'
            },
            {
                field: 'performer',
                title: '演员'
            },
            {
                field: 'countryName',
                title: '国家'
            },
            {
                field: 'oneTypeName',
                title: '一级分类'
            },
            {
                field: 'twoTypeName',
                title: '类型'
            },
            {
                field: 'languageName',
                title: '语言'
            },
            {
                field: 'detailCount',
                title: '集数'
            },

            {
                field: 'createTime',
                title: '创建时间'
            },
            {
                field: 'updateTime',
                title: '最后更新时间'
            },
            {
                title: '操作',
                align: 'center',
                formatter: function (value, row, index) {
                    var actions = [];
                    actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                    actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                    return actions.join('');
                }
            }]
    };
    $.table.init(options);
});